class Base{   //父类
   public int a=1;
   public int b=2;
   public int s=0;
}

class Derived extends Base{  //子类,如果子类有会优先访问子类的;如果子类没有再去看父类的，如果两个都没有，报错！
    public int a=100;
    public int c=3;
    public int s=4;
 public void test(){
    // System.out.println(a);
     System.out.println(super.a);  //关键字super.加上后优先访问父类
     System.out.println(b);
     System.out.println(c);
     System.out.println(this.s); //this.访问的就是子类的s
 }
}
public class test3 {
    public static void main(String[] args) {
        Derived derived=new Derived();
        derived.test();
    }
}
